	<?php
if ($_SESSION[acesso_administrador]){
	include("include/configuracoes.php");
	$codigo = $_GET[codigo];
	$sql = "select * from integrante WHERE id_integrante='$codigo'";	
	$resultado = mysql_query($sql);
	while($campos = mysql_fetch_array($resultado)) {
		echo"
			<script language='JavaScript' type='text/javascript' src='js/valida/valida_formularios.js'></script>
			<form name='form_alt_integrante' method='post' action='index.php?arquivo=altera_integrante.php' onsubmit='javascript: return validaAltIntegrante()'>
				<table>
					<tr>
						<td>Nome:</td>
						<td><input type='text' name='nome' size='20' maxlength='100' value='$campos[nome]'></td>
					</tr>
					<tr>
						<td>E-mail ou Lattes:</td>
						<td><input type='text' name='contato' size='20' maxlength='100'"?><?php if($campos[exibir]==1){ echo"value='$campos[lattes]'";}else echo"value='$campos[email]'"; echo "<?php?></td>
					</tr>
					<tr>
						<td>Tipo:</td>
						<td><input type='radio' name='tipo' value='0' "?><?php if($campos[exibir]==0){ echo"Checked";}echo ">E-mail
							<input type='radio' name='tipo' value='1' "?><?php if($campos[exibir]==1){ echo"Checked";}echo ">Lattes</td>  
					</tr>
                                        <tr>
						<td>Status:</td>
						<td><input type='radio' name='status' value='0' "?><?php if($campos[status]==0){ echo"Checked";}echo ">Integrante
							<input type='radio' name='status' value='1' "?><?php if($campos[status]==1){ echo"Checked";}echo ">Ex-Integrante</td>  
					</tr>
					<tr>
						<td>Curso:</td>
						<td><select name='curso' size='1'>
							<option value='$campos[id_curso]'>Selecione</option>
	";			
								$y = 0;
								$query2 = "SELECT * FROM curso";
								$resultado2 = mysql_query($query2);
								while($campo = mysql_fetch_array($resultado2)){
									$descricao[$y] = $campo['descricao'];
									$id_curso[$y] = $campo['id_curso'];
									echo"<option value='$id_curso[$y]' selected>$descricao[$y]</option>";
									$y++;
								}
	echo "
						</select></td>
					</tr>
					<tr>
						<td colspan='2'>
						<input type='hidden' name='codigo' value='$codigo'>
						<input type='submit' name='alterar' value='Alterar'></td>
					</tr>
				</table>
			</form>
		";
	}
}else{
	
}
?>
